import axios from "./axios.js";

// 用户登录
export const userLogin = async (params) => {  
  return await axios.post('/login', params)
}

// 获取碳纤维车架列表
export const getAllFrameList = async (params) => {
  return await axios.get('/getAllFrameList', {params})
}

// 获取铝合金车架列表
export const getAllFrame2List = async (params) => {
  return await axios.get('/getAllFrame2List', {params})
}

// 添加到购物车
export const addToCart = (data) => {
  return axios.post('/cart/add', data)
}

// 获取购物车列表
export const getCartList = () => {
  return axios.get('/cart/list')
}

// 从购物车移除商品
export const removeFromCart = (id) => {
  return axios.delete(`/cart/remove/${id}`)
}

// 获取用户信息
export const getUserInfo = () => {
  return axios.get('/user/info')
}

// 获取用户购物车列表
export const getUserCartList = () => {
  return axios.get('/cart/list')
}

